//
//  JSKitManager+Lable.m
//  NiubilityProject
//
//  Created by Apple on 2018/5/14.
//  Copyright © 2018年 Apple. All rights reserved.
//

#import "JSKitManager+Lable.h"

@implementation JSKitManager (Lable)

-(js_sting)label_text{
    
    __weak typeof(self) weakSelf = self;
    return ^JSKitManager*(NSString *text){
        weakSelf.js_UIlabel.text = text;
        weakSelf.js_YYlabel.text = text;
        return weakSelf;
    };
}

-(js_color)label_textColor{
    __weak typeof (self) weakSelf = self;
    return ^JSKitManager *(UIColor *textColor){
        weakSelf.js_UIlabel.textColor = textColor;
        weakSelf.js_YYlabel.textColor = textColor;
        return weakSelf;
    };
}
-(js_textFont)label_font{
    __weak typeof (self)weakSelf = self;
    return ^JSKitManager *(UIFont *font){
        weakSelf.js_YYlabel.font = font;
        weakSelf.js_UIlabel.font = font;
        return weakSelf;
    };
}
-(js_color)label_shadowColor{
    __weak typeof(self)weakSelf = self;
    return ^JSKitManager *(UIColor *color){
        weakSelf.js_YYlabel.shadowColor = color;
        weakSelf.js_UIlabel.shadowColor = color;
        return weakSelf;
    };
}
-(js_size)label_shadowOffset{
    __weak typeof(self)weakSelf = self;
    return ^JSKitManager *(CGSize offset){
        weakSelf.js_YYlabel.shadowOffset = offset;
        weakSelf.js_UIlabel.shadowOffset = offset;
        return weakSelf;
    };
}
-(js_textAlignment)label_textAlignment{
    __weak typeof(self) weakSelf = self;
    return ^JSKitManager *(NSTextAlignment alignment){
        weakSelf.js_UIlabel.textAlignment = alignment;
        weakSelf.js_YYlabel.textAlignment = alignment;
        return weakSelf;
    };
}
-(js_lineBreakMode)label_lineBreakMode{
    __weak typeof (self) weakSelf = self;
    return ^JSKitManager *(NSLineBreakMode lineBreakModel){
        weakSelf.js_UIlabel.lineBreakMode = lineBreakModel;
        weakSelf.js_YYlabel.lineBreakMode = lineBreakModel;
        return weakSelf;
    };
    
}
-(js_attributedString)label_attributedString{
    __weak typeof(self) weakSelf = self;
    return ^JSKitManager *(NSMutableAttributedString *attrStr){
        weakSelf.js_UIlabel.attributedText = attrStr;
        weakSelf.js_YYlabel.attributedText = attrStr;
        return weakSelf;
    };
}
-(js_color)label_highlightedTextColor{
    __weak typeof(self) weakSelf = self;
    return ^JSKitManager *(UIColor *higlitColor){
        weakSelf.js_UIlabel.highlightedTextColor = higlitColor;
        return weakSelf;
    };
}
-(js_bool)label_highlighted{
    __weak typeof(self) weakSelf = self;
    return ^JSKitManager *(BOOL highlit){
        weakSelf.js_UIlabel.highlighted = highlit;
        return weakSelf;
    };
}
//-(js_bool)label_userInteractionEnabled{
//    __weak typeof(self) weakSelf = self;
//    return ^JSKitManager *(BOOL interaction){
//        weakSelf.js_UIlabel.userInteractionEnabled = interaction;
//        weakSelf.js_YYlabel.userInteractionEnabled = interaction;
//        return weakSelf;
//    };
//}
-(js_bool)label_enabled{
    __weak typeof(self) weakSelf = self;
    return ^JSKitManager *(BOOL enable){
        weakSelf.js_UIlabel.enabled = enable;
        return weakSelf;
    };
}
-(js_bool)label_adjustsFontSizeToFitWidth{
    __weak typeof(self) weakSelf = self;
    return ^JSKitManager *(BOOL adjusts){
        weakSelf.js_UIlabel.adjustsFontSizeToFitWidth = adjusts;
        return weakSelf;
    };
}
-(js_integer)label_numberOfLines{
    __weak typeof(self) weakSelf = self;
    return ^JSKitManager *(NSInteger lines){
        weakSelf.js_UIlabel.numberOfLines = lines;
        weakSelf.js_YYlabel.numberOfLines = lines;
        return weakSelf;
    };
}
-(js_baselineAdjustment)label_baselineAdjustment{
    __weak typeof(self) weakSelf = self;
    return ^JSKitManager *(UIBaselineAdjustment baseLineAdjustment){
        weakSelf.js_UIlabel.baselineAdjustment = baseLineAdjustment;
        return weakSelf;
    };
}
- (js_float )label_minimumScaleFactor
{
    __weak typeof(self) weakSelf = self;
    
    return ^JSKitManager *(CGFloat minimumScaleFactor){
        weakSelf.js_UIlabel.minimumScaleFactor = minimumScaleFactor;
        return weakSelf;
    };
}

- (js_float )label_preferredMaxLayoutWidth
{
    __weak typeof(self) weakSelf = self;
    
    return ^JSKitManager *(CGFloat preferredMaxLayoutWidth){
        weakSelf.js_UIlabel.preferredMaxLayoutWidth = preferredMaxLayoutWidth;
        return weakSelf;
    };
}
- (js_bool )label_allowsDefaultTighteningForTruncation
{
    __weak typeof(self) weakSelf = self;
    
    return ^JSKitManager *(BOOL allowsDefaultTighteningForTruncation){
        weakSelf.js_UIlabel.allowsDefaultTighteningForTruncation = allowsDefaultTighteningForTruncation;
        return weakSelf;
    };
}

@end
